//
// Created by mabinjie on 2024/10/28.
//

#ifndef EMPTY_BODY_HPP
#define EMPTY_BODY_HPP
#include "jtt808_body.hpp"

namespace protocol {

class EmptyBody : public jtt808_body {
protected:
    [[nodiscard]] size_t size() const override {
        return 0;
    }

public:
    EmptyBody() = default;

    explicit EmptyBody(const uint16_t message_id)
        : jtt808_body(message_id) {
    }

    EmptyBody(const EmptyBody &other) = default;

    EmptyBody(EmptyBody &&other) noexcept = default;

    EmptyBody & operator=(const EmptyBody &other) = default;

    EmptyBody & operator=(EmptyBody &&other) noexcept = default;

    [[nodiscard]] std::string toString() const override {
        return "Empty body";
    }

    void serialize(common::MessagePackWriter &writer) override { }

    void deserialize(common::MessagePackReader &reader) override {}
};

}

#endif //EMPTY_BODY_HPP
